package org.feng.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.feng.entity.Permission;
import org.feng.mapper.PermissionMapper;
import org.feng.service.IPermissionService;
import org.springframework.stereotype.Service;

import java.util.Set;
import java.util.stream.Collectors;

/**
 * <p>
 * 权限表 服务实现类
 * </p>
 *
 * @author fengjinsong
 * @since 2023-09-02
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements IPermissionService {

    @Override
    public Set<String> listPermissionCodeByIds(Set<Integer> permissionIdSet) {
        return this.listByIds(permissionIdSet).stream()
                .map(Permission::getCode)
                .collect(Collectors.toSet());
    }
}
